﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace VectorEditor
{
    class InsertPrimitiveCommand : Command
    {
        private Primitive prim;

        public InsertPrimitiveCommand(Primitive prim)
        {
            // TODO: Complete member initialization
            this.prim = prim;
        }
        public override void Execute(Document doc)
        {
            doc.Primitives.Add(prim);
            doc.FinishUpdate();
        }

        public override void Undo(Document doc)
        {
            doc.Primitives.RemoveAt(doc.Primitives.Count - 1);
            doc.FinishUpdate();
        }
    }
}
